package itdep.ui.pages.address;

import ga.tapestry.StateConstants;
import ga.tapestry.commonlib.base.pages.EntityPage;
import itdep.domain.address.Settlement;
import itdep.services.address.SettlementService;
import org.apache.tapestry5.ioc.annotations.Inject;

/**
 * @author Ivan Khalopik
 * @version $Revision: 45 $ $Date: 2010-07-03 08:04:49 +0000 (Sat, 03 Jul 2010) $
 */
public class Settlements extends EntityPage<Settlement> {

	@Inject
	private SettlementService settlementService;

	@Override
	protected SettlementService getEntityService() {
		return settlementService;
	}

	public boolean isEditable() {
		final String state = getState();
		return StateConstants.ADD_STATE.equals(state) || StateConstants.EDIT_STATE.equals(state);
	}
}
